<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
		<!--ios是否运行创建快捷启动方式-->
		<meta content="yes" name="apple-mobile-web-app-capable">
		<!--ios顶部通知栏的样式 黑色-->
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<!--遇到数字不让转成电话号码格式-->
		<meta content="telephone=no" name="format-detection">
		<meta name="referrer" content="never">
		<script src="js/remstyle.js"></script>
		<title>一键导入</title>
		<link rel="stylesheet" type="text/css" href="common/css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/open_btn.css" />
		<link rel="stylesheet" type="text/css" href="css/import_page.css" />
		<script type="text/javascript" src="js/vue.js"></script>
		<script src="https://unpkg.com/vue/dist/vue.js"></script>
		<script type="application/javascript " src="js/jquery-1.7.2.min.js "></script>
		<script src="layer/layer.js"></script>
		<link rel="stylesheet" type="text/css" href="layer/skin/layer.css" />
		<script src="js/config.js"></script>
	</head>
	<style>
	label{
		/*border: 1px solid red;*/
		position: relative;
		padding: 0;
		height: 28px;
	}
.pl_text{
	position: absolute;
	top: 0;
	left: 4px;
	line-height: 26px;
	/*border: 1px solid red;*/
	color: #fff;	
}

	</style>

	<body>
		<div class="top">
			<div class="top-one" onclick="javascript :history.back(-1);">
				<span><img src="img_page/right.png"/></span>
			</div>
			<div class="point" style="opacity: 0;">
				<img src="img_page/3point.png" />
			</div>
		</div>
		<!--中间提示图片-->
		<div class="import_center">
			<img src="img_page/import_center_img.png" />
			<span>只支持微信文章导入</span>
		</div>
		<!--链接输入框-->
		<div style="margin: 0 auto;text-align: center;margin-bottom: 0.3rem;">
			<input class="import_input" id="import_input" placeholder="复制粘贴文章的地址" />
		</div>
		<div class="import_ad">
			<span>默认植入广告</span>
			<label><input class="mui-switch mui-switch-animbg"  type="checkbox" checked=""/>
			<span class="pl_text">开</span>
			</label>
		</div>
		<div class="import_btn">
			<img src="img_page/import_btn.png" onclick="import_page()" />
		</div>
		<!--底部内容-->
		<div class="import_bottom">
			<img src="img_page/import_bottom.png" />
		</div>
	</body>
	<script type="application/javascript " src="js/jquery-1.7.2.min.js "></script>
	<script>
		$(function() {
			var win_h = $(window).height(); //关键代码
			window.addEventListener('resize', function() {
				if($(window).height() < win_h) {
					$('.import_bottom').hide();
				} else {
					$('.import_bottom').show();
				}
			});

		});

		function import_page() {
			console.log(2222)
			var url = document.getElementById("import_input").value;
			if(!url) {
				layer.msg("请输入文章地址")
			} else {
				$.ajax({
					type: "get",
					url: v_url + "/wechat/singlepage/oneImport",
					data: {
						url: url,
						c_user_id:c_user_id
					},
					async: false,
					success: function(res) {
						var id = res.data.id
						if(res.code == 200) {
							layer.msg("导入成功", function() {
									window.location.href = "min_page_add.html?url=" + id + '&c_user_id=' + c_user_id
								}

							)
						} else {
							layer.msg("导入失败")
						}
					}
				});
			}

		}
	</script>

</html>